package 数据结构.章节09._162_带最小值的栈;

import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;

/**
 * @author 挚爱之夕
 * @date 2021/10/13 - 10 - 13 - 17:16
 * @Description: 数据结构.章节09._162_带最小值的栈
 * @Version: 1.0
 */
public class StackWithMinTest {
    StackWithMin stack = new StackWithMin();
    @Test
    @Before
    public void push() {
        stack.push(3);
        stack.push(2);
        stack.push(10);
        stack.push(1);
    }

    @Test
    public void min() {
        Assert.assertEquals(1,stack.min());
        stack.pop();
        Assert.assertEquals(2,stack.min());
        stack.pop();
        Assert.assertEquals(2,stack.min());
        stack.pop();
        Assert.assertEquals(3,stack.min());
        stack.pop();
//        Assert.assertEquals(3,stack.min());   //抛出异常
    }
}